package com.lebo.web.domain;

import java.io.Serializable;
import java.time.ZoneId;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

import org.apache.ibatis.type.Alias;

@Alias("blogDetail")
public class BlogDetail implements Serializable{
    private static final long serialVersionUID = 6943672875147021144L;
    private long id;
    private String title;
    private String description;
    private String content;
    private String icon;
    private String contentImg;
    private Date createTime;
    private String createYear;
    private String createMMdd;

    public long getId() {
        return id;
    }
    public void setId(long id) {
        this.id = id;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    public String getIcon() {
        return icon;
    }
    public void setIcon(String icon) {
        this.icon = icon;
    }
    public String getContentImg() {
        return contentImg;
    }
    public void setContentImg(String contentImg) {
        this.contentImg = contentImg;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getCreateYear() {
        return createYear;
    }
    public BlogDetail setCreateYear() {
        Calendar c = Calendar.getInstance(TimeZone.getTimeZone(ZoneId.of("CTT")));
        c.setTime(createTime);
        this.createYear = c.get(Calendar.YEAR)+"";
        return this;
    }
    public String getCreateMMdd() {
        return createMMdd;
    }
    public BlogDetail setCreateMMdd() {
        Calendar c = Calendar.getInstance(TimeZone.getTimeZone(ZoneId.of("CTT")));
        c.setTime(createTime);
        this.createMMdd = c.get(Calendar.MONTH)+"-"+c.get(Calendar.DAY_OF_MONTH);
        return this;
    }
}